<template>
	<view>
		<scroll-view scroll-y class="fui-scroll__view">
			<fui-checkbox-group @change="changeCheck">
				<fui-label v-for="(item,index) in list" :key="index">
					<fui-list-cell>
						<view class="fui-align__center w100 rowSpaceBetween">
							<text class="fui-text">{{item.label}}</text>
							<fui-checkbox :checked="item.checked" :value="item.value" color="#fb5f46"
								borderColor="#B2B2B2" borderRadius="8rpx">
							</fui-checkbox>
						</view>
					</fui-list-cell>
				</fui-label>
			</fui-checkbox-group>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		name: "scrollYCheckbox",
		props: {
			list: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {
				vals: ''
			};
		},
		methods: {
			changeCheck(e) {
				console.log(e.detail.value);
				this.$emit('update:modelValue', e.detail.value);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.fui-scroll__view {
		width: 100%;
		height: 600rpx;
	}
</style>